import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: HomeView,
    children:[
      // 首页
      {
        path: '/admin/index',
        component: () => import('../views/admin/AdminIndexView.vue')
      },
      {
        path: '/admin/account/user',
        component: () => import('../views/admin/account/UserListView.vue')
      },
      {
        path: '/admin/account/user/add-new',
        component: () => import('../views/admin/account/UserAddNewView.vue')
      },
      {
        path: 'admin/content/banner',
        component: () => import('../views/admin/content/BannerAddNewView')
      },
      {
        path: 'admin/content/goods',
        component: () => import('../views/admin/content/GoodsListView.vue')
      },
      {
        path: 'admin/content/goods/add-new',
        component: () => import('../views/admin/content/GoodsAddNewView.vue')
      },
      {
        path:'admin/content/comment',
        component: () => import('../views/admin/content/CommentListView.vue')
      },
      {
        path: '/admin/content/categories',
        component: () => import('../views/admin/content/CategoryListView.vue')
      },
      {
        path: '/admin/content/categories/add-new',
        component: () => import('../views/admin/content/CategoryAddNewView.vue')
      },
      {
        path:'admin/content/member/add-new',
        component: () => import('../views/admin/content/MemberAddNewView.vue')
      },
      {
        path:'admin/content/member',
        component: () => import('../views/admin/content/MemberListView.vue')
      },
      {
        path:'admin/content/fadeback',
        component: () => import('../views/admin/content/FadebackListView.vue')
      },
    ]
  },
  {
    path: '/login',
    component: () => import('../views/LoginView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
